HTMLify

admin login.html
Views: 142 | Author: sachinthakur
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Admin Login</title>
</head>
<body>

<header>
  <div class="container">
    <div class="logo"><img src="https://png.pngtree.com/png-vector/20230316/ourmid/pngtree-admin-and-customer-service-job-vacancies-vector-png-image_6650726.png" height="50px" width="100px"></div>
    <div class="hamburger-menu" onclick="toggleNav()">
      &#9776;
    </div>
    <nav id="mainNav">
      <ul>
        <li><a href="#">Home</a></li>
        <li><a href="#">About</a></li>
        <li><a href="#">Contact</a></li>
      </ul>
    </nav>
  </div>
</header>

<div class="intro">
  Welcome to the Admin Login Page. Please login to proceed.
</div>

<main>
  <h2>Login</h2>
  <form id="loginForm">
    <input type="text" name="username" placeholder="Username">
    <input type="password" name="password" placeholder="Password">
    <input type="submit" value="Login">
  </form>
</main>
</body>
</html>

<style>
    body {
      font-family: Arial, sans-serif;
      margin: 0;
      padding: 0;
      background-image: url('https://e1.pxfuel.com/desktop-wallpaper/581/154/desktop-wallpaper-backgrounds-for-login-page-login-page.jpg'); 
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      color: #fff;
    }
    header {
      background-color: rgba(0, 0, 0, 0.7);
      padding: 10px 0;
      text-align: center;
    }
    .container {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 20px;
    }
    .logo {
      font-size: 24px;
    }
    .hamburger-menu {
      display: none;
      cursor: pointer;
    }
    nav {
      background-color: rgba(0, 0, 0, 0.7);
      padding: 10px 0;
      text-align: center;
    }
    nav ul {
      list-style-type: none;
      padding: 0;
      margin: 0;
    }
    nav ul li {
      display: inline-block;
    }
    nav ul li a {
      color: #fff;
      text-decoration: none;
      margin: 0 20px;
    }
    main {
      padding: 20px;
      text-align: center;
    }
  
    form {
      margin: 0 auto;
      width: 300px;
      background-color: rgba(255, 255, 255, 0.7);
      padding: 20px;
      border-radius: 10px;
    }
    input[type="text"],
    input[type="password"],
    input[type="submit"] {
      display: block;
      margin: 10px auto;
      padding: 10px;
      width: calc(100% - 20px);
    }
    .intro {
      text-align: center;
      margin-top: 50px;
      font-size: 18px;
    }
    @media (max-width: 768px) {
      .container {
        flex-direction: column;
      }
      .hamburger-menu {
        display: block;
      }
      nav {
        display: none;
      }
      nav.active {
        display: block;
      }
      nav ul {
        flex-direction: column;
        padding: 20px;
        background-color: rgba(0, 0, 0, 0.7);
      }
      nav ul li {
        display: block;
        margin-bottom: 10px;
      }
    }
  </style>

  
<script>
    function toggleNav() {
      var nav = document.getElementById('mainNav');
      nav.classList.toggle('active');
    }
  
    document.getElementById("loginForm").addEventListener("submit", function(event) {
      event.preventDefault();
      var username = document.getElementsByName("username")[0].value;
      var password = document.getElementsByName("password")[0].value;
  
     
      if (username.trim() === "" || password.trim() === "") {
        alert("Please enter both username and password");
      } else {
        
        alert("Login successful!");
      }
    });
  </script>

Comments